﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Battle.Effects
{
    public class BaseEffect : IEffect
    {
        public bool IsDebuff { get; }
        public int? Duration { get; private set; }
        public int MaxLayer { get; private set; }
        public string Name { get; private set; }
        public IEntity Owner { get; set; }
        public BaseEffect(EffectDef def)
        {
            Duration = def.duration;
            MaxLayer = def.maxOverlay;
            Name = def.name;
            IsDebuff = def.isDebuff;
        }

        public virtual void OnRoundBegin()
        {

        }

        public virtual void OnRoundEnd()
        {
            if (Duration is int duration)
            {
                duration -= 1;
                if (duration <= 0)
                {
                    Owner.RemoveEffect(this);
                }
            }
        }
        public virtual OnAbilityApply(ref Ability which)
        {
            return null;
        }

        public virtual void OnAbilitySpell(Ability which)
        {
            
        }
    }
}
